package com.unit.test.enumeration;

public enum Sex {

	female(0,"female"),
	male(1,"male"),
	;
	private int index;
	private String desc;
	
	Sex(int index, String desc){
		this.index = index;
		this.desc = desc;
	}
	
	public static Sex findIndex(int index) {
		switch (index) {
		case 0:
			return Sex.female;
		case 1:
			return Sex.male;
		default:
			return null;
		}
	}
	
	public int getIndex() {
		return index;
	}
	
	public String getDesc() {
		return desc;
	}
}
